fftools: do not access out of bounds filtergraph
authorMarvin Scholz <epirat07@gmail.com>
Tue, 1 Oct 2024 00:57:11 +0000 (02:57 +0200)
committerSebastian Ramacher <sramacher@debian.org>
Sun, 27 Oct 2024 17:31:51 +0000 (18:31 +0100)
The log message was logged for `filtergraphs[j]` which would cause a
heap buffer overflow in certain circumstances.

Correctly it should be logged for the current filtergraph, so just
use `fg` here.

(cherry picked from commit 5beeb3a1f97d8f6d4076fe83aaf5e2e5871f945e)

Gbp-Pq: Name 0005-fftools-do-not-access-out-of-bounds-filtergraph.patch

fftools/ffmpeg_filter.c

index 7ec328e04eaa4eda30ddd7ad7a852d5265d623ce..2f2b2979328b27ba2b5f98bc6b3fe9bcabf53106 100644 (file)
@@ -1408,7 +1408,7 @@ int fg_finalise_bindings(void)
         for (int j = 0; j < fg->nb_outputs; j++) {
             OutputFilter *output = fg->outputs[j];
             if (!output->bound) {
-                av_log(filtergraphs[j], AV_LOG_FATAL,
+                av_log(fg, AV_LOG_FATAL,
                        "Filter %s has an unconnected output\n", output->name);
                 return AVERROR(EINVAL);
             }